<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        background-color: rgb(113, 143, 229);
      }

      .box {
        width: 100%;
        height: 100%;
        overflow: hidden;
      }

      .content {
        width: 500px;
        height: 350px;
        background-color: white;
        border-radius: 15px;
        margin: auto;
        margin-top: 10%;
        text-align: center;
        overflow: hidden;
      }

      .content .title {
        display: flex;
        align-items: center;
        width: 500px;
        height: 50px;
        justify-content: center;
        border-radius: 15px;
        margin-top: 50px;
      }

      .content .username {
        position: relative;
        margin-top: 25px;
      }

      .content .username .input1 {
        width: 400px;
        height: 30px;
        border: 1px solid rgb(220, 220, 220);
        border-radius: 5px;
        background-color: rgb(232, 240, 254);
        outline: none;
        padding-left: 50px;
      }

      .content .username i {
        cursor: pointer;
      }
    </style>
  </head>

  <body>
    <div class="box">
      <div class="content">
        <div class="title">
          <i
            style="
              width: 30px;
              height: 30px;
              padding-right: 10px;
              background: url(./img/che.png) no-repeat;
              background-size: contain;
            "
          ></i>
          <p style="font-weight: bold">厚浦外卖总后台管理系统</p>
        </div>
        <div class="form">
          <div class="username">
            <input type="text" class="input1" />
            <i
              style="
                position: absolute;
                left: 40px;
                top: 9px;
                width: 15px;
                height: 15px;
                background: url(./img/ren.png) no-repeat;
                background-size: contain;
              "
            ></i>
            <i
              class="dui"
              style="
                position: absolute;
                border-radius: 50%;
                right: 30px;
                top: 9px;
                width: 15px;
                height: 15px;
                background: url(./img/dui.png) no-repeat;
                background-size: contain;
              "
            ></i>
          </div>
          <div class="username">
            <input type="password" class="input1" />
            <i
              style="
                position: absolute;
                left: 40px;
                top: 9px;
                width: 15px;
                height: 15px;
                background: url(./img/suo.png) no-repeat;
                background-size: contain;
              "
            ></i>
            <i
              class="yan"
              style="
                position: absolute;
                border-radius: 50%;
                right: 55px;
                top: 11px;
                width: 20px;
                height: 20px;
                background: url(./img/yan.png) no-repeat;
                background-size: contain;
              "
            ></i>
            <i
              class="dui"
              style="
                position: absolute;
                border-radius: 50%;
                right: 30px;
                top: 9px;
                width: 15px;
                height: 15px;
                background: url(./img/dui.png) no-repeat;
                background-size: contain;
              "
            ></i>
          </div>
        </div>
        <div class="small-title">
          <p
            style="
              width: 480px;
              cursor: pointer;
              margin: 0;
              margin-top: 10px;
              text-align: right;
              font-size: 14px;
              color: gray;
            "
          >
            忘记账号/密码？
          </p>
        </div>
        <button
          style="
            width: 450px;
            height: 30px;
            margin-top: 20px;
            background-color: rgb(64, 158, 255);
            color: white;
            border: 0;
            border-radius: 3px;
          "
        >
          登录
        </button>
      </div>
    </div>

    <script>
      var input = document.querySelectorAll("input");
      var dui = document.querySelectorAll(".dui");
      var yan = document.querySelector(".yan");

      dui[0].style.display = "none";
      dui[1].style.display = "none";

      input[0].addEventListener("input", function () {
        dui[0].style.display = input[0].value !== "" ? "block" : "none";
      });

      input[1].addEventListener("input", function () {
        dui[1].style.display = input[1].value !== "" ? "block" : "none";
      });

      yan.onclick = function () {
        input[1].type = input[1].type === "password" ? "text" : "password";
      };
    </script>
  </body>
</html>
